package cn.juque.lucenecandy.core.datasync.listener;

import cn.juque.lucenecandy.core.base.BaseMessageEntity;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>IWriteListener</li>
 * </ul>
 * @date 2024-01-04
 **/
public interface IMsgWriteListener {

    /**
     * 事前操作
     * <li>可实现监听器，根据需要变更、读取报文</li>
     *
     * @param messageEntity 消息实体
     * @return boolean: false 取消写入索引
     */
    Boolean before(BaseMessageEntity messageEntity);

    /**
     * 事后操作
     *<li>可实现监听器，根据需要变更、读取报文</li>
     * @param messageEntity 消息实体
     */
    void after(BaseMessageEntity messageEntity);
}
